package com.controller;
    
    



import $pkType;
import $entityType;
import com.service.CustomerService;
import lombok.AllArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 控制层
 *
 * @author makejava
 * @since 2025-01-04 00:23:42
 */
@RestController
@RequestMapping("/customer")
@AllArgsConstructor
public class CustomerController {

	private CustomerService customerService;

	/**
	 * 获取列表(分页)
	 */
	@GetMapping("/list")
	public Page<Customer> list(Pageable page) {
		return null;
	}

	/**
	 * 获取
	 */
	@GetMapping("/get")
	public Customer get( id) {
		return customerService.findById(id);
	}

	/**
	 * 添加
	 */
	@PostMapping("/add")
	public void add(@RequestBody Customer customer) {
		customerService.save(customer);
	}


	/**
	 * 修改
	 */
	@PostMapping("/update")
	public void update(@RequestBody Customer customer) {
		customerService.save(customer);
	}

	/**
	 * 删除
	 */
	@PostMapping("/delete")
	public void delete( id) {
		customerService.deleteById(id);
	}

}

